* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.container {
    width: 960px;
    margin: 30px auto 0;
}
#header, #navigation, #mainbody, #sidebar, #footer {
    height: 100px;
    line-height: 25px;
    background: #eee;
    margin-bottom: 20px;
    text-align: center;
    overflow: hidden;
}

#mainbody, #sidebar {
    height: 300px;
    float: left;
    padding: 10px;
}
#mainbody {
    width: 620px;
    margin-right: 20px;
    background: red;
}
#sidebar {
    width: calc(100% - 640px);
    background: pink;
}
#footer {
    clear: both;
    background:yellow;
}

@media screen and (min-width: 1200px) {
    .container {
        width: 1170px;
    }
    #mainbody {
        width: 960px;
    }
    #sidebar {
        width: calc(100% - 980px);
    }
}

/*流动布局*/
@media screen and (max-width: 959px) {
    .container {
        width: 100%;
        padding: 0 20px;
    }
    #mainbody {
        width: 60%;
    }
    #sidebar {
        width: 35%;
        float: right;
    }
}

@media screen and (max-width: 757px){
    #mainbody, #sidebar {
        float: none;
        width: 100%;
    }
}